{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/"
    },
    "id": "-eavtskwiZT6",
    "outputId": "659c2f32-1b22-4ce1-efc0-5cbb32959bbd"
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "/content/race/input/train.csv\n",
      "/content/race/input/test.csv\n"
     ]
    }
   ],
   "source": [
    "# This Python 3 environment comes with many helpful analytics libraries installed\r\n",
    "# It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python\r\n",
    "# For example, here's several helpful packages to load\r\n",
    "\r\n",
    "import numpy as np # linear algebra\r\n",
    "import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\r\n",
    "\r\n",
    "# Input data files are available in the read-only \"../input/\" directory\r\n",
    "# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory\r\n",
    "\r\n",
    "import os\r\n",
    "for dirname, _, filenames in os.walk('/content/race/input'):\r\n",
    "    for filename in filenames:\r\n",
    "        print(os.path.join(dirname, filename))\r\n",
    "\r\n",
    "# You can write up to 5GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using \"Save & Run All\" \r\n",
    "# You can also write temporary files to /kaggle/temp/, but they won't be saved outside of the current session"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "id": "Xu4u75c3qqF1"
   },
   "outputs": [],
   "source": [
    "import pandas as pd\r\n",
    "import numpy as np\r\n",
    "from sklearn import preprocessing\r\n",
    "import matplotlib.pyplot as plt\r\n",
    "import seaborn as sns\r\n",
    "from sklearn.metrics import confusion_matrix, accuracy_score, classification_report\r\n",
    "from sklearn.tree import DecisionTreeClassifier\r\n",
    "from sklearn.model_selection import cross_val_score \r\n",
    "from sklearn.ensemble import RandomForestClassifier\r\n",
    "import xgboost\r\n",
    "from sklearn.model_selection import train_test_split\r\n",
    "from sklearn.feature_extraction.text import CountVectorizer\r\n",
    "import warnings\r\n",
    "np.random.seed(123)\r\n",
    "warnings.filterwarnings('ignore')\r\n",
    "from sklearn.pipeline import make_pipeline\r\n",
    "from sklearn.preprocessing import StandardScaler\r\n",
    "from sklearn.model_selection import GridSearchCV\r\n",
    "import csv"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/",
     "height": 419
    },
    "id": "RJ3N95rMtImY",
    "outputId": "89ccf376-a66e-4c95-b499-dd3950aac432"
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Unnamed: 0</th>\n",
       "      <th>article</th>\n",
       "      <th>class</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>my husband is a born shopper . he loves to loo...</td>\n",
       "      <td>high</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>tea drinking was common in china for nearly on...</td>\n",
       "      <td>high</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2</td>\n",
       "      <td>once upon a time , there was a scholar who wan...</td>\n",
       "      <td>high</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>3</td>\n",
       "      <td>when newspapers and radio describe the damage ...</td>\n",
       "      <td>high</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>4</td>\n",
       "      <td>below is a page adapted from about wikipedia o...</td>\n",
       "      <td>high</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25132</th>\n",
       "      <td>25132</td>\n",
       "      <td>joe brown had a shop . he sold meat in his sho...</td>\n",
       "      <td>middle</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25133</th>\n",
       "      <td>25133</td>\n",
       "      <td>if you do not use your arms or your legs for s...</td>\n",
       "      <td>middle</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25134</th>\n",
       "      <td>25134</td>\n",
       "      <td>mrs. jones is waiting for an important telepho...</td>\n",
       "      <td>middle</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25135</th>\n",
       "      <td>25135</td>\n",
       "      <td>new york is a very large city with 8 million p...</td>\n",
       "      <td>middle</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25136</th>\n",
       "      <td>25136</td>\n",
       "      <td>there are 45 students in our class . i have ma...</td>\n",
       "      <td>middle</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>25137 rows × 3 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "       Unnamed: 0                                            article   class\n",
       "0               0  my husband is a born shopper . he loves to loo...    high\n",
       "1               1  tea drinking was common in china for nearly on...    high\n",
       "2               2  once upon a time , there was a scholar who wan...    high\n",
       "3               3  when newspapers and radio describe the damage ...    high\n",
       "4               4  below is a page adapted from about wikipedia o...    high\n",
       "...           ...                                                ...     ...\n",
       "25132       25132  joe brown had a shop . he sold meat in his sho...  middle\n",
       "25133       25133  if you do not use your arms or your legs for s...  middle\n",
       "25134       25134  mrs. jones is waiting for an important telepho...  middle\n",
       "25135       25135  new york is a very large city with 8 million p...  middle\n",
       "25136       25136  there are 45 students in our class . i have ma...  middle\n",
       "\n",
       "[25137 rows x 3 columns]"
      ]
     },
     "execution_count": 13,
     "metadata": {
      "tags": []
     },
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#train_dataset = pd.read_csv(\"/content/race/input/train.csv\",)\r\n",
    "train_dataset = pd.read_csv(\"/content/race/input/train.csv\")\r\n",
    "train_dataset\r\n",
    "#with open(\"/content/race/input/train.csv\",encode=\"utf-8\") as f:\r\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "id": "tJqN6fJutMSp"
   },
   "outputs": [],
   "source": [
    "from matplotlib import pyplot as plt\r\n",
    "import seaborn as sns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/",
     "height": 376
    },
    "id": "qhvILtorteQ1",
    "outputId": "a01224e5-202b-4380-edc2-332d57d314fa"
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0x7f2ee4341dd8>"
      ]
     },
     "execution_count": 14,
     "metadata": {
      "tags": []
     },
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAnEAAAFVCAYAAACAWLmFAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAZ70lEQVR4nO3df7BfdX3n8efLRPwJI0jKIiENstEuWEslpayuXQtVo7MVtFXJWInUITqKP2bdVnR3i4tlx61aR1hLN9YIOBbUIpJ2YzFGV7etKIkiv5QlRJRkIsSgYv2BBd/7x/1c/RLvTa7hfu/J5/J8zJz5nvM+v97nj9x55Zzz+X5TVUiSJKkvDxm6AUmSJP3iDHGSJEkdMsRJkiR1yBAnSZLUIUOcJElShwxxkiRJHVo4dANz7dBDD62lS5cO3YYkSdJebd68+VtVtWiqdQ+6ELd06VI2bdo0dBuSJEl7leTr063zcaokSVKHDHG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QJ0mS1KH/D00vviVUqCoUAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 720x360 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light",
      "tags": []
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Visualizing the variable - 'year'\r\n",
    "plt.figure(figsize = (10,5))\r\n",
    "plt.xticks(rotation=90)\r\n",
    "sns.countplot(train_dataset['class'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "id": "OJvxsUrKtgnB"
   },
   "outputs": [],
   "source": [
    "from fastai.text import *"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "id": "JD9eQeSyufdk"
   },
   "outputs": [],
   "source": [
    "from pathlib import Path"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {
    "id": "km4dd1EbuhVg"
   },
   "outputs": [],
   "source": [
    "path = Path('/content/race/input/')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/",
     "height": 53
    },
    "id": "F3e_eaQLulKw",
    "outputId": "e5f66bbe-a4a3-4db0-e23b-2d697e589536"
   },
   "outputs": [
    {
     "data": {
      "text/html": [],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {
      "tags": []
     },
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {
      "tags": []
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "CPU times: user 3.93 s, sys: 621 ms, total: 4.55 s\n",
      "Wall time: 35.7 s\n"
     ]
    }
   ],
   "source": [
    "%%time\r\n",
    "data_lm = TextLMDataBunch.from_csv(path,'train.csv', text_cols = \"article\", label_cols = \"class\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/",
     "height": 53
    },
    "id": "5pyRCjZXu8x4",
    "outputId": "00165fba-1c8d-4db8-9e18-c1ba3df98fdd"
   },
   "outputs": [
    {
     "data": {
      "text/html": [],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {
      "tags": []
     },
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {
      "tags": []
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "CPU times: user 5.13 s, sys: 683 ms, total: 5.81 s\n",
      "Wall time: 37 s\n"
     ]
    }
   ],
   "source": [
    "%%time\r\n",
    "data_clas = TextClasDataBunch.from_csv(path, 'train.csv', vocab=data_lm.train_ds.vocab, bs=32, text_cols = \"article\", label_cols = \"class\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/"
    },
    "id": "90pQgEPQvF-4",
    "outputId": "1f0b8b9e-b816-40cb-f2f4-cee6a6f0a9d3"
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "TextClasDataBunch;\n",
       "\n",
       "Train: LabelList (20109 items)\n",
       "x: TextList\n",
       "xxbos paris in the springtime was , is and always will be , something rather special . why not experience it for yourself with this excellent break for four days ? this attractive city has something to offer to everyone and with prices at just ps129 . your break begins with comfortable bus transfer from local pick - up points and travel to paris is via cross - channel ferry , arriving at your hotel in the evening . the ibis is an excellent quality hotel with private equipments in all rooms : satellite tv , radio , telephone and alarm clock . it has a bar and restaurant and is situated about two miles south of notre dame enabling you to explore paris with ease . the following day , after continental breakfast ( included ) , the bus takes you on a comprehensive sightseeing tour of the city , during which you will see the eiffel tower , champs elysees , l'arc de triomphe , the louvre , in fact almost every famous landmark you have ever heard of . you then leave paris and take a short drive to the magnificent palace of versailles , the home of louis xiv . the tour ends mid - afternoon back in paris where you will have the remainder of the day at your leisure . in the evening there is a ` ` paris by night '' tour showing you the beautiful buildings with bright lights . day three takes you to xxunk , perhaps the most attractive quarter of paris and home of the sacre coeur and the moulin rouge . in the afternoon you are free to explore this beautiful city as you wish , perhaps a pleasure voyage on the river seine , wander around the beautiful gardens or look among the antique shops . in the evening you will have the opportunity to visit the best nightclub in the city , the splendid xxunk xxunk . on the final day it 's back to the uk via channel ferry . included in the price of ps129 per person : * return comfortable bus travel to paris * return ferry crossings * 3 nights housing in a twin bedded room in a central paris hotel with private facilities * continental breakfast during your stay * guided sightseeing tour of ` ` paris by day '' and paris by night '' * visit to the chateau of versailles ( admission not included ) * tour around montmartre * services of experienced bi - lingual tour guide at all times,xxbos drunken driving -sometimes called america 's socially accepted form of murder -- has become a national epidemic . every hour of every day about three americans on average are killed by drunken drivers , adding up to an incredible 250,000 over the past ten years . a drunken driver is usually referred to as one with xxunk alcohol content or roughly three beer glasses of wine or shots of whisky drunk within two hours . heavy drinking used to be an acceptable part of the american manly image and judges were in most courts , but the drunken killing has recently caused so many well - publicized tragedies , especially concerning young children , that public opinion is no longer so tolerant . twenty states have raised the legal drinking age to 21 , reversing a trend in the 1960s to reduce it to 18 . after new jersey lowered it to 18 , the number of people killed by 18 - 20 years old drivers more than doubled , so the state recently upped it back to 21 . reformers , however , fear raising the drinking age will have little effect unless accompanied by educational programs to help young people to develop ' responsible attitudes ' about drinking and teach them to resist peer pressure to drink . though new laws have led to increased arrests and tests in many areas already , to a marked drop in accidents , some states are also punishing bars for serving customers too many drinks . a bar in massachusetts was fined for serving six or more double xxunk to a customer who was ' obviously drunk ' and later drove off the road , killing a 9-year - old boy . as the accidents continue to occur daily in every state , some americans are even beginning to speak well of the 13 years national prohibition of alcohol that began in 1919 , which president hoover called the ' noble experiment ' . they forgot that legal prohibition did n't stop drinking , but encouraged political corruption and organized crime . as with the booming drug trade generally , there is no easy solution .,xxbos by 2050 , half of the world 's population will live in the tropics -- the ly warm belt that circles the globe -- according to state of the tropics , a report released today . rapid population growth , along with economic growth , means that the region 's influence will grow in coming decades , the authors of the xxunk work predict . the project , first launched in 2011 , aimed to answer one significant question : is life in the tropics improving ? to find out , the researchers analyzed environmental , social , and economic indicators collected over 6 decades . it finds that the region has made ` ` extraordinary progress '' in many areas . for example , more people have access to safe drinking water , and the number of protected areas is increasing . the tropics also have outperformed the rest of the world in economic growth over the past 30 years . however , some challenges remain . investment in research and development , for example , has increased cautiously , but tropical nations still invest less than the rest of the world . ` ` as a proportion of gdp the rest of the world invests almost four times as much in research and development than the tropics . '' concludes the report . the report also includes a new analysis of how climate change will affect the region . many plant and animal species are moving xxunk in an attempt to stay within their preferred environmental conditions in the tropics , the authors write . however , some organisms may not be able to keep pace with the changing conditions , they predict . as a result , they can experience population declines or go extinct . in addition , an expanded tropical zone also threatens health and safety issues , the authors warn . as regions become more suitable to insects such as mosquitoes and ticks , the spread of insect - borne diseases such as malaria , dengue , and xxunk disease could rise , causing a burden to human health and the economy . xxunk , a researcher , says he sees a lot to be concerned about in the report . ` ` while we ' ve made incredible advances in some areas , i think the risks for the tropics that are highlighted in this report are things that we really need to be concerned about . '',xxbos 3d printers are certainly the superstar today -- -they are being put to all kinds of uses , including creating model cars for movies . however , none of these ideas are as crazy as the one suggested by anjan contractor , who believes that they will be the key to ending world hunger . if you think that sounds a little crazy , you are not the only one , but after hearing scientists , the idea seems to become true . according to scientists , food will become _ expensive and possibly , even out of reach , for billions of people in the future . it means billions of people wo n't have enough food . this is where 3d printers may save the day . anjan , an engineer says that the only way to support the large population will be to provide every kitchen with a 3d printer and print out meals . more importantly , it would be to make the basic food from things that we now do not think can be eaten . anjan thinks that we could easily get the meat protein from insects . similarly , the vegetable nutrition could be made from greens like grass . would you want to try 3d printed food ?,xxbos i can still remember it as if it happened yesterday . i was a college freshman and had stayed up most of the night before laughing and talking with friends . now just before my first class of the day my eyelids were feeling heavier and heavier and my head was drifting down to my desk to make my textbook a pillow . a few minutes ' nap time before class could n't hurt , i thought . boom ! i lifted my head immediately and my eyes opened wider than saucers . i looked around with my heart beating quickly trying to find the cause of the noise . my young professor was looking back at me with a _ , boyish smile on his face . he had intentionally dropped the pile of textbooks he was carrying onto my desk . ` ` good morning ! '' he said , still smiling . ` ` i ' m glad to see everyone is awake . now let 's get started . '' for the next hour i was n't sleepy at all . it was n't from the shock of my professor 's textbook alarm clock either . instead , it was from the attractive discussion he led . with knowledge and good humor , he made the material come alive . his insights were full of both wisdom and loving kindness . and the enthusiasm and joy that he taught with were contagious . i left the classroom not only wide awake , but a little smarter and a little better as well . i learned something far more important than not sleeping in class that day too . i learned that if you are going to do something in this life , do it well , do it with joy , and make it an expression of your love . what a glorious place this world would be if all of us did our work joyously and well ! what a beautiful world we could create if every doctor , teacher , musician , cook , waitress , poet , miner , farmer , and laborer made their work an expression of their love ! do n't sleepwalk your way through life then . wake up ! let your love fill your work and your soul . life is too short not to live it well .\n",
       "y: CategoryList\n",
       "high,high,high,middle,high\n",
       "Path: /content/race/input;\n",
       "\n",
       "Valid: LabelList (5028 items)\n",
       "x: TextList\n",
       "xxbos living in a modern society has its advantages and disadvantages . one disadvantage is that you often have to live closer to other people than you would like to . sometimes , your neighbors make a noise that you are not comfortable with . the best way to solve this problem is to talk with your neighbor first . you should be very polite and ask your neighbor if he knows how thin the walls of your homes are . this way does n't criticize his behavior ; it simply points out that he may not realize how far his sound travels . tell him that you know that sometimes you make noise as well , but that you do your best to keep it down . often this will solve the problem right away , but sometimes the neighbor may become angry . if your neighbor becomes angry with you , there are some more steps you can take . you might write a letter to the neighborhood committee . make sure you write down the source of the noise and the time in the letter . they will review the situation and decide whether your neighbor is out of line . some noise is considered to be _ , even if it bothers you . so you may prepare a good pair of earplugs . even if your neighbor makes too much noise , you do n't have to live your life in discomfort . it 's always a good idea to be friendly with your neighbors . you may clean the rubbish in front of his door . he 's sure to appreciate behavior like this and be more open to your suggestions about noise level .,xxbos a gunman opened fire in orlando 's pulse nightclub early morning sunday , killing approximately 50 people and injuring another 53 . xxunk were enjoying an evening at pulse , which describes itself as ` ` the hottest gay bar in orlando , ` ` when shots started to go off around 2 am . a hostage situation occurred , and did n't end until authorities used a vehicle armed to teeth to break down the door of the building and kill the gunman at around 5 am . sunday morning 's attack surpasses the shootings at virginia tech in 2007 and xxunk hook elementary school in 2012 to become the worst mass shooting in us history . authorities have identified the shooter as 29-year - old omar xxunk mateen from fort pierce , about 120 miles southeast of orlando . cnn reports mr . mateen was previously trained as a security guard . the federal government and fbi ` ` have suggestions the individual has xxunk towards islamic terrorism , but right now we ca n't say definitely , ` ` says ron hopper , assistant special agent of fbi 's orlando bureau . but mateen 's connection to islamic terrorism has not been proven , leading authorities to also investigate the shooting as a possible hate crime against the lgbt community . the orlando blood donation facility tweeted that the bank was in ` ` urgent need ` ` of donations sunday morning following the shooting . but within hours , they announced their bank was at capacity due to the long lines of volunteers who showed up to donate . however , after the initial tweet at 10:40 sunday morning , criticisms of the united states ' stand on blood donation by the lgbt community resurfaced on social media from those who wanted to help but were prohibited due to their sexuality . '' it 's legal to buy an xxunk assault rifle . it 's illegal for a gay man to donate blood to victims of the massacre . the world makes no sense . ` ` said john xxunk . ( lgbt : a community of four types of people ; lesbian , gay , xxunk , transgender . ),xxbos dear dr . white , welcome to philadelphia ! welcome to the city of brotherly love ! we have some amazing historic sites to see during your stay . do take advantage of them . you may have seen the xxunk . actually it is a comedy and still popular among the young though it was shot in the 1940s . ` ` the city of brotherly love '' , the favored nickname for philadelphia , is more popular . the name , philadelphia , which means '' brotherly love '' , is an ancient name that can be found in the bible . late in the 17th century , philadelphia 's founding father , william penn , borrowed the name because its meaning represented his own beliefs . our first stop will be the franklin institute which is one of the country 's best science museums . the scientist and inventor benjamin franklin would take pride in the impressive museum named for him and presenting one of the major focuses of his life work -- spreading knowledge of the universe through science . it 's the most visited museum and surely the most fun . benjamin franklin was one of the founding fathers of the united states . also franklin was a leading author , printer , politician , scientist , musician , inventor , statesman , and diplomat . as a scientist , he was a major figure in the american enlightenment and the history of physics for his discoveries and theories regarding electricity . he earned the title of '' the first american '' for his campaigning for colonial unity ; as an author and spokesman in london for several colonies , then as the first united states ambassador to france , he contributed much to the building of the american nation . we wo n't miss please touch museum too . the straightforward name of this museum is accurate : as the first museum in the nation to target children aged seven and younger , please touch museum encourages children to learn through active touching and doing . it is certainly one of the best places for kids . philadelphia is also unique in that it has a '' state store '' system for non - alcoholic beer sales . wine and spirits are only sold at stores operated by the pennsylvania liquor control board . for many years , these stores were called '' state store '' , which were strictly closed on sundays to prevent those under 21 from drinking wine and harming others . but i will show you around the stores . you ca n't imagine how impressive the stores are . do you know segway ? it is a two - wheeled self - balancing battery - powered electric vehicle which is popular among those who prefer personal and green transportation . the segway tour is a unique and fun experience to travel in philadelphia . if you have never experienced a segway tour before , we expect you to join us . look forward to your coming ! sincerely , joy,xxbos mr . jones and mr . brown work in the same office . one day mr . jones says to mr . brown , ` ` i will have a small party at our house on monday evening . would you and your wife like to come ? '' mr . brown says , ` ` thank you very much . i 'd love to , but let me ask my wife first . '' so mr . brown goes to the other room and telephones his wife . then he comes back and looks very _ . ` ` what 's the matter ? '' asks mr . jones . ` ` is your wife there at home ? '' ` ` no , '' answers mr . brown . ` ` she is n't there . my son answers the telephone . i say to him , ' is your mother here , david ? ' and he answers , ' no , she is n't in the house . ' ' where is she ? ' i ask . ' she is somewhere outside . ' ' what 's she doing ? ' ' she is looking for me . ' '',xxbos friends with kids was put on in american theatres on march 9th , 2012 . its writer and director is jennifer westfeldt . it 's a _ about some friends at that time in life when children arrive and everything changes . it will make you feel happy and funny and ca n't help laughing . in the movie , the last two singles westfeldt and adam scott , decided to make a test -- to have a kid together and meet other people . most people will be surprised at what happens in the movie . it can help you think of more about your love for your xxunk and family . the famous stars in the movie are adam scott . jennifer westfeldt , jon xxunk , kristen xxunk , maya rudolph , chris xxunk , megan fox , and edward burns . you can also visit this movie 's official website . , .\n",
       "y: CategoryList\n",
       "high,high,high,middle,middle\n",
       "Path: /content/race/input;\n",
       "\n",
       "Test: None"
      ]
     },
     "execution_count": 20,
     "metadata": {
      "tags": []
     },
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_clas"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {
    "id": "Is_LRN_WvHxh"
   },
   "outputs": [],
   "source": [
    "bs=16"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/",
     "height": 35
    },
    "id": "CMfZWnT-vPhx",
    "outputId": "f80697c2-53f8-48a4-a55d-da7925855f21"
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Downloading https://s3.amazonaws.com/fast-ai-modelzoo/wt103-fwd.tgz\n"
     ]
    },
    {
     "data": {
      "text/html": [],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {
      "tags": []
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "learn = language_model_learner(data_lm, AWD_LSTM, drop_mult=0.5)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/",
     "height": 80
    },
    "id": "7EcMyP_DvuAi",
    "outputId": "b85bbd33-74f5-4571-a908-bb2a49ea035d"
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: left;\">\n",
       "      <th>epoch</th>\n",
       "      <th>train_loss</th>\n",
       "      <th>valid_loss</th>\n",
       "      <th>accuracy</th>\n",
       "      <th>time</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>0</td>\n",
       "      <td>4.332078</td>\n",
       "      <td>4.042467</td>\n",
       "      <td>0.275956</td>\n",
       "      <td>07:30</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {
      "tags": []
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "learn.fit_one_cycle(1, 1e-2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/",
     "height": 142
    },
    "id": "Vd0pxtBOw1u4",
    "outputId": "6e2e95ec-566d-482a-cd70-e69c1c32121f"
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: left;\">\n",
       "      <th>epoch</th>\n",
       "      <th>train_loss</th>\n",
       "      <th>valid_loss</th>\n",
       "      <th>accuracy</th>\n",
       "      <th>time</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>0</td>\n",
       "      <td>4.140218</td>\n",
       "      <td>3.989223</td>\n",
       "      <td>0.282471</td>\n",
       "      <td>08:46</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>1</td>\n",
       "      <td>3.980434</td>\n",
       "      <td>3.826196</td>\n",
       "      <td>0.298410</td>\n",
       "      <td>08:47</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2</td>\n",
       "      <td>3.653732</td>\n",
       "      <td>3.769302</td>\n",
       "      <td>0.305054</td>\n",
       "      <td>08:47</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {
      "tags": []
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "learn.unfreeze()\r\n",
    "learn.fit_one_cycle(3, slice(1e-4,1e-2))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/",
     "height": 35
    },
    "id": "lZ9Tc8zZzQxC",
    "outputId": "f26f0107-0525-492f-d052-92e84f0d804d"
   },
   "outputs": [
    {
     "data": {
      "application/vnd.google.colaboratory.intrinsic+json": {
       "type": "string"
      },
      "text/plain": [
       "'This is a review about the effect of each eye , earning attention on the'"
      ]
     },
     "execution_count": 25,
     "metadata": {
      "tags": []
     },
     "output_type": "execute_result"
    }
   ],
   "source": [
    "learn.predict(\"This is a review about\", n_words=10)\r\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/",
     "height": 35
    },
    "id": "19TKXR3_zTkx",
    "outputId": "429272a6-4c57-4a3e-8463-43c83dada2e3"
   },
   "outputs": [
    {
     "data": {
      "application/vnd.google.colaboratory.intrinsic+json": {
       "type": "string"
      },
      "text/plain": [
       "'This game is one of the  greatest games for men in history , one of the'"
      ]
     },
     "execution_count": 26,
     "metadata": {
      "tags": []
     },
     "output_type": "execute_result"
    }
   ],
   "source": [
    "learn.predict(\"This game is one of the \", n_words=10)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {
    "id": "LT_ulpR8zZy_"
   },
   "outputs": [],
   "source": [
    "learn.model_dir = Path('/content/race/working/')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {
    "id": "ttJ8E4JGzmuQ"
   },
   "outputs": [],
   "source": [
    "learn.save(file = Path('language_model'))\r\n",
    "learn.save_encoder(Path('language_model_encoder'))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/"
    },
    "id": "yPqw5O2bzpcQ",
    "outputId": "712e4d70-7212-45c9-b9a2-b58b5acc6ce1"
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "RNNLearner(data=TextClasDataBunch;\n",
       "\n",
       "Train: LabelList (20109 items)\n",
       "x: TextList\n",
       "xxbos paris in the springtime was , is and always will be , something rather special . why not experience it for yourself with this excellent break for four days ? this attractive city has something to offer to everyone and with prices at just ps129 . your break begins with comfortable bus transfer from local pick - up points and travel to paris is via cross - channel ferry , arriving at your hotel in the evening . the ibis is an excellent quality hotel with private equipments in all rooms : satellite tv , radio , telephone and alarm clock . it has a bar and restaurant and is situated about two miles south of notre dame enabling you to explore paris with ease . the following day , after continental breakfast ( included ) , the bus takes you on a comprehensive sightseeing tour of the city , during which you will see the eiffel tower , champs elysees , l'arc de triomphe , the louvre , in fact almost every famous landmark you have ever heard of . you then leave paris and take a short drive to the magnificent palace of versailles , the home of louis xiv . the tour ends mid - afternoon back in paris where you will have the remainder of the day at your leisure . in the evening there is a ` ` paris by night '' tour showing you the beautiful buildings with bright lights . day three takes you to xxunk , perhaps the most attractive quarter of paris and home of the sacre coeur and the moulin rouge . in the afternoon you are free to explore this beautiful city as you wish , perhaps a pleasure voyage on the river seine , wander around the beautiful gardens or look among the antique shops . in the evening you will have the opportunity to visit the best nightclub in the city , the splendid xxunk xxunk . on the final day it 's back to the uk via channel ferry . included in the price of ps129 per person : * return comfortable bus travel to paris * return ferry crossings * 3 nights housing in a twin bedded room in a central paris hotel with private facilities * continental breakfast during your stay * guided sightseeing tour of ` ` paris by day '' and paris by night '' * visit to the chateau of versailles ( admission not included ) * tour around montmartre * services of experienced bi - lingual tour guide at all times,xxbos drunken driving -sometimes called america 's socially accepted form of murder -- has become a national epidemic . every hour of every day about three americans on average are killed by drunken drivers , adding up to an incredible 250,000 over the past ten years . a drunken driver is usually referred to as one with xxunk alcohol content or roughly three beer glasses of wine or shots of whisky drunk within two hours . heavy drinking used to be an acceptable part of the american manly image and judges were in most courts , but the drunken killing has recently caused so many well - publicized tragedies , especially concerning young children , that public opinion is no longer so tolerant . twenty states have raised the legal drinking age to 21 , reversing a trend in the 1960s to reduce it to 18 . after new jersey lowered it to 18 , the number of people killed by 18 - 20 years old drivers more than doubled , so the state recently upped it back to 21 . reformers , however , fear raising the drinking age will have little effect unless accompanied by educational programs to help young people to develop ' responsible attitudes ' about drinking and teach them to resist peer pressure to drink . though new laws have led to increased arrests and tests in many areas already , to a marked drop in accidents , some states are also punishing bars for serving customers too many drinks . a bar in massachusetts was fined for serving six or more double xxunk to a customer who was ' obviously drunk ' and later drove off the road , killing a 9-year - old boy . as the accidents continue to occur daily in every state , some americans are even beginning to speak well of the 13 years national prohibition of alcohol that began in 1919 , which president hoover called the ' noble experiment ' . they forgot that legal prohibition did n't stop drinking , but encouraged political corruption and organized crime . as with the booming drug trade generally , there is no easy solution .,xxbos by 2050 , half of the world 's population will live in the tropics -- the ly warm belt that circles the globe -- according to state of the tropics , a report released today . rapid population growth , along with economic growth , means that the region 's influence will grow in coming decades , the authors of the xxunk work predict . the project , first launched in 2011 , aimed to answer one significant question : is life in the tropics improving ? to find out , the researchers analyzed environmental , social , and economic indicators collected over 6 decades . it finds that the region has made ` ` extraordinary progress '' in many areas . for example , more people have access to safe drinking water , and the number of protected areas is increasing . the tropics also have outperformed the rest of the world in economic growth over the past 30 years . however , some challenges remain . investment in research and development , for example , has increased cautiously , but tropical nations still invest less than the rest of the world . ` ` as a proportion of gdp the rest of the world invests almost four times as much in research and development than the tropics . '' concludes the report . the report also includes a new analysis of how climate change will affect the region . many plant and animal species are moving xxunk in an attempt to stay within their preferred environmental conditions in the tropics , the authors write . however , some organisms may not be able to keep pace with the changing conditions , they predict . as a result , they can experience population declines or go extinct . in addition , an expanded tropical zone also threatens health and safety issues , the authors warn . as regions become more suitable to insects such as mosquitoes and ticks , the spread of insect - borne diseases such as malaria , dengue , and xxunk disease could rise , causing a burden to human health and the economy . xxunk , a researcher , says he sees a lot to be concerned about in the report . ` ` while we ' ve made incredible advances in some areas , i think the risks for the tropics that are highlighted in this report are things that we really need to be concerned about . '',xxbos 3d printers are certainly the superstar today -- -they are being put to all kinds of uses , including creating model cars for movies . however , none of these ideas are as crazy as the one suggested by anjan contractor , who believes that they will be the key to ending world hunger . if you think that sounds a little crazy , you are not the only one , but after hearing scientists , the idea seems to become true . according to scientists , food will become _ expensive and possibly , even out of reach , for billions of people in the future . it means billions of people wo n't have enough food . this is where 3d printers may save the day . anjan , an engineer says that the only way to support the large population will be to provide every kitchen with a 3d printer and print out meals . more importantly , it would be to make the basic food from things that we now do not think can be eaten . anjan thinks that we could easily get the meat protein from insects . similarly , the vegetable nutrition could be made from greens like grass . would you want to try 3d printed food ?,xxbos i can still remember it as if it happened yesterday . i was a college freshman and had stayed up most of the night before laughing and talking with friends . now just before my first class of the day my eyelids were feeling heavier and heavier and my head was drifting down to my desk to make my textbook a pillow . a few minutes ' nap time before class could n't hurt , i thought . boom ! i lifted my head immediately and my eyes opened wider than saucers . i looked around with my heart beating quickly trying to find the cause of the noise . my young professor was looking back at me with a _ , boyish smile on his face . he had intentionally dropped the pile of textbooks he was carrying onto my desk . ` ` good morning ! '' he said , still smiling . ` ` i ' m glad to see everyone is awake . now let 's get started . '' for the next hour i was n't sleepy at all . it was n't from the shock of my professor 's textbook alarm clock either . instead , it was from the attractive discussion he led . with knowledge and good humor , he made the material come alive . his insights were full of both wisdom and loving kindness . and the enthusiasm and joy that he taught with were contagious . i left the classroom not only wide awake , but a little smarter and a little better as well . i learned something far more important than not sleeping in class that day too . i learned that if you are going to do something in this life , do it well , do it with joy , and make it an expression of your love . what a glorious place this world would be if all of us did our work joyously and well ! what a beautiful world we could create if every doctor , teacher , musician , cook , waitress , poet , miner , farmer , and laborer made their work an expression of their love ! do n't sleepwalk your way through life then . wake up ! let your love fill your work and your soul . life is too short not to live it well .\n",
       "y: CategoryList\n",
       "high,high,high,middle,high\n",
       "Path: /content/race/input;\n",
       "\n",
       "Valid: LabelList (5028 items)\n",
       "x: TextList\n",
       "xxbos living in a modern society has its advantages and disadvantages . one disadvantage is that you often have to live closer to other people than you would like to . sometimes , your neighbors make a noise that you are not comfortable with . the best way to solve this problem is to talk with your neighbor first . you should be very polite and ask your neighbor if he knows how thin the walls of your homes are . this way does n't criticize his behavior ; it simply points out that he may not realize how far his sound travels . tell him that you know that sometimes you make noise as well , but that you do your best to keep it down . often this will solve the problem right away , but sometimes the neighbor may become angry . if your neighbor becomes angry with you , there are some more steps you can take . you might write a letter to the neighborhood committee . make sure you write down the source of the noise and the time in the letter . they will review the situation and decide whether your neighbor is out of line . some noise is considered to be _ , even if it bothers you . so you may prepare a good pair of earplugs . even if your neighbor makes too much noise , you do n't have to live your life in discomfort . it 's always a good idea to be friendly with your neighbors . you may clean the rubbish in front of his door . he 's sure to appreciate behavior like this and be more open to your suggestions about noise level .,xxbos a gunman opened fire in orlando 's pulse nightclub early morning sunday , killing approximately 50 people and injuring another 53 . xxunk were enjoying an evening at pulse , which describes itself as ` ` the hottest gay bar in orlando , ` ` when shots started to go off around 2 am . a hostage situation occurred , and did n't end until authorities used a vehicle armed to teeth to break down the door of the building and kill the gunman at around 5 am . sunday morning 's attack surpasses the shootings at virginia tech in 2007 and xxunk hook elementary school in 2012 to become the worst mass shooting in us history . authorities have identified the shooter as 29-year - old omar xxunk mateen from fort pierce , about 120 miles southeast of orlando . cnn reports mr . mateen was previously trained as a security guard . the federal government and fbi ` ` have suggestions the individual has xxunk towards islamic terrorism , but right now we ca n't say definitely , ` ` says ron hopper , assistant special agent of fbi 's orlando bureau . but mateen 's connection to islamic terrorism has not been proven , leading authorities to also investigate the shooting as a possible hate crime against the lgbt community . the orlando blood donation facility tweeted that the bank was in ` ` urgent need ` ` of donations sunday morning following the shooting . but within hours , they announced their bank was at capacity due to the long lines of volunteers who showed up to donate . however , after the initial tweet at 10:40 sunday morning , criticisms of the united states ' stand on blood donation by the lgbt community resurfaced on social media from those who wanted to help but were prohibited due to their sexuality . '' it 's legal to buy an xxunk assault rifle . it 's illegal for a gay man to donate blood to victims of the massacre . the world makes no sense . ` ` said john xxunk . ( lgbt : a community of four types of people ; lesbian , gay , xxunk , transgender . ),xxbos dear dr . white , welcome to philadelphia ! welcome to the city of brotherly love ! we have some amazing historic sites to see during your stay . do take advantage of them . you may have seen the xxunk . actually it is a comedy and still popular among the young though it was shot in the 1940s . ` ` the city of brotherly love '' , the favored nickname for philadelphia , is more popular . the name , philadelphia , which means '' brotherly love '' , is an ancient name that can be found in the bible . late in the 17th century , philadelphia 's founding father , william penn , borrowed the name because its meaning represented his own beliefs . our first stop will be the franklin institute which is one of the country 's best science museums . the scientist and inventor benjamin franklin would take pride in the impressive museum named for him and presenting one of the major focuses of his life work -- spreading knowledge of the universe through science . it 's the most visited museum and surely the most fun . benjamin franklin was one of the founding fathers of the united states . also franklin was a leading author , printer , politician , scientist , musician , inventor , statesman , and diplomat . as a scientist , he was a major figure in the american enlightenment and the history of physics for his discoveries and theories regarding electricity . he earned the title of '' the first american '' for his campaigning for colonial unity ; as an author and spokesman in london for several colonies , then as the first united states ambassador to france , he contributed much to the building of the american nation . we wo n't miss please touch museum too . the straightforward name of this museum is accurate : as the first museum in the nation to target children aged seven and younger , please touch museum encourages children to learn through active touching and doing . it is certainly one of the best places for kids . philadelphia is also unique in that it has a '' state store '' system for non - alcoholic beer sales . wine and spirits are only sold at stores operated by the pennsylvania liquor control board . for many years , these stores were called '' state store '' , which were strictly closed on sundays to prevent those under 21 from drinking wine and harming others . but i will show you around the stores . you ca n't imagine how impressive the stores are . do you know segway ? it is a two - wheeled self - balancing battery - powered electric vehicle which is popular among those who prefer personal and green transportation . the segway tour is a unique and fun experience to travel in philadelphia . if you have never experienced a segway tour before , we expect you to join us . look forward to your coming ! sincerely , joy,xxbos mr . jones and mr . brown work in the same office . one day mr . jones says to mr . brown , ` ` i will have a small party at our house on monday evening . would you and your wife like to come ? '' mr . brown says , ` ` thank you very much . i 'd love to , but let me ask my wife first . '' so mr . brown goes to the other room and telephones his wife . then he comes back and looks very _ . ` ` what 's the matter ? '' asks mr . jones . ` ` is your wife there at home ? '' ` ` no , '' answers mr . brown . ` ` she is n't there . my son answers the telephone . i say to him , ' is your mother here , david ? ' and he answers , ' no , she is n't in the house . ' ' where is she ? ' i ask . ' she is somewhere outside . ' ' what 's she doing ? ' ' she is looking for me . ' '',xxbos friends with kids was put on in american theatres on march 9th , 2012 . its writer and director is jennifer westfeldt . it 's a _ about some friends at that time in life when children arrive and everything changes . it will make you feel happy and funny and ca n't help laughing . in the movie , the last two singles westfeldt and adam scott , decided to make a test -- to have a kid together and meet other people . most people will be surprised at what happens in the movie . it can help you think of more about your love for your xxunk and family . the famous stars in the movie are adam scott . jennifer westfeldt , jon xxunk , kristen xxunk , maya rudolph , chris xxunk , megan fox , and edward burns . you can also visit this movie 's official website . , .\n",
       "y: CategoryList\n",
       "high,high,high,middle,middle\n",
       "Path: /content/race/input;\n",
       "\n",
       "Test: None, model=SequentialRNN(\n",
       "  (0): MultiBatchEncoder(\n",
       "    (module): AWD_LSTM(\n",
       "      (encoder): Embedding(41904, 400, padding_idx=1)\n",
       "      (encoder_dp): EmbeddingDropout(\n",
       "        (emb): Embedding(41904, 400, padding_idx=1)\n",
       "      )\n",
       "      (rnns): ModuleList(\n",
       "        (0): WeightDropout(\n",
       "          (module): LSTM(400, 1152, batch_first=True)\n",
       "        )\n",
       "        (1): WeightDropout(\n",
       "          (module): LSTM(1152, 1152, batch_first=True)\n",
       "        )\n",
       "        (2): WeightDropout(\n",
       "          (module): LSTM(1152, 400, batch_first=True)\n",
       "        )\n",
       "      )\n",
       "      (input_dp): RNNDropout()\n",
       "      (hidden_dps): ModuleList(\n",
       "        (0): RNNDropout()\n",
       "        (1): RNNDropout()\n",
       "        (2): RNNDropout()\n",
       "      )\n",
       "    )\n",
       "  )\n",
       "  (1): PoolingLinearClassifier(\n",
       "    (layers): Sequential(\n",
       "      (0): BatchNorm1d(1200, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
       "      (1): Dropout(p=0.2, inplace=False)\n",
       "      (2): Linear(in_features=1200, out_features=50, bias=True)\n",
       "      (3): ReLU(inplace=True)\n",
       "      (4): BatchNorm1d(50, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
       "      (5): Dropout(p=0.1, inplace=False)\n",
       "      (6): Linear(in_features=50, out_features=2, bias=True)\n",
       "    )\n",
       "  )\n",
       "), opt_func=functools.partial(<class 'torch.optim.adam.Adam'>, betas=(0.9, 0.99)), loss_func=FlattenedLoss of CrossEntropyLoss(), metrics=[<function accuracy at 0x7f2e90106730>], true_wd=True, bn_wd=True, wd=0.01, train_bn=True, path=PosixPath('/content/race/input'), model_dir=PosixPath('/content/race/working'), callback_fns=[functools.partial(<class 'fastai.basic_train.Recorder'>, add_time=True, silent=False)], callbacks=[RNNTrainer\n",
       "learn: RNNLearner(data=TextClasDataBunch;\n",
       "\n",
       "Train: LabelList (20109 items)\n",
       "x: TextList\n",
       "xxbos paris in the springtime was , is and always will be , something rather special . why not experience it for yourself with this excellent break for four days ? this attractive city has something to offer to everyone and with prices at just ps129 . your break begins with comfortable bus transfer from local pick - up points and travel to paris is via cross - channel ferry , arriving at your hotel in the evening . the ibis is an excellent quality hotel with private equipments in all rooms : satellite tv , radio , telephone and alarm clock . it has a bar and restaurant and is situated about two miles south of notre dame enabling you to explore paris with ease . the following day , after continental breakfast ( included ) , the bus takes you on a comprehensive sightseeing tour of the city , during which you will see the eiffel tower , champs elysees , l'arc de triomphe , the louvre , in fact almost every famous landmark you have ever heard of . you then leave paris and take a short drive to the magnificent palace of versailles , the home of louis xiv . the tour ends mid - afternoon back in paris where you will have the remainder of the day at your leisure . in the evening there is a ` ` paris by night '' tour showing you the beautiful buildings with bright lights . day three takes you to xxunk , perhaps the most attractive quarter of paris and home of the sacre coeur and the moulin rouge . in the afternoon you are free to explore this beautiful city as you wish , perhaps a pleasure voyage on the river seine , wander around the beautiful gardens or look among the antique shops . in the evening you will have the opportunity to visit the best nightclub in the city , the splendid xxunk xxunk . on the final day it 's back to the uk via channel ferry . included in the price of ps129 per person : * return comfortable bus travel to paris * return ferry crossings * 3 nights housing in a twin bedded room in a central paris hotel with private facilities * continental breakfast during your stay * guided sightseeing tour of ` ` paris by day '' and paris by night '' * visit to the chateau of versailles ( admission not included ) * tour around montmartre * services of experienced bi - lingual tour guide at all times,xxbos drunken driving -sometimes called america 's socially accepted form of murder -- has become a national epidemic . every hour of every day about three americans on average are killed by drunken drivers , adding up to an incredible 250,000 over the past ten years . a drunken driver is usually referred to as one with xxunk alcohol content or roughly three beer glasses of wine or shots of whisky drunk within two hours . heavy drinking used to be an acceptable part of the american manly image and judges were in most courts , but the drunken killing has recently caused so many well - publicized tragedies , especially concerning young children , that public opinion is no longer so tolerant . twenty states have raised the legal drinking age to 21 , reversing a trend in the 1960s to reduce it to 18 . after new jersey lowered it to 18 , the number of people killed by 18 - 20 years old drivers more than doubled , so the state recently upped it back to 21 . reformers , however , fear raising the drinking age will have little effect unless accompanied by educational programs to help young people to develop ' responsible attitudes ' about drinking and teach them to resist peer pressure to drink . though new laws have led to increased arrests and tests in many areas already , to a marked drop in accidents , some states are also punishing bars for serving customers too many drinks . a bar in massachusetts was fined for serving six or more double xxunk to a customer who was ' obviously drunk ' and later drove off the road , killing a 9-year - old boy . as the accidents continue to occur daily in every state , some americans are even beginning to speak well of the 13 years national prohibition of alcohol that began in 1919 , which president hoover called the ' noble experiment ' . they forgot that legal prohibition did n't stop drinking , but encouraged political corruption and organized crime . as with the booming drug trade generally , there is no easy solution .,xxbos by 2050 , half of the world 's population will live in the tropics -- the ly warm belt that circles the globe -- according to state of the tropics , a report released today . rapid population growth , along with economic growth , means that the region 's influence will grow in coming decades , the authors of the xxunk work predict . the project , first launched in 2011 , aimed to answer one significant question : is life in the tropics improving ? to find out , the researchers analyzed environmental , social , and economic indicators collected over 6 decades . it finds that the region has made ` ` extraordinary progress '' in many areas . for example , more people have access to safe drinking water , and the number of protected areas is increasing . the tropics also have outperformed the rest of the world in economic growth over the past 30 years . however , some challenges remain . investment in research and development , for example , has increased cautiously , but tropical nations still invest less than the rest of the world . ` ` as a proportion of gdp the rest of the world invests almost four times as much in research and development than the tropics . '' concludes the report . the report also includes a new analysis of how climate change will affect the region . many plant and animal species are moving xxunk in an attempt to stay within their preferred environmental conditions in the tropics , the authors write . however , some organisms may not be able to keep pace with the changing conditions , they predict . as a result , they can experience population declines or go extinct . in addition , an expanded tropical zone also threatens health and safety issues , the authors warn . as regions become more suitable to insects such as mosquitoes and ticks , the spread of insect - borne diseases such as malaria , dengue , and xxunk disease could rise , causing a burden to human health and the economy . xxunk , a researcher , says he sees a lot to be concerned about in the report . ` ` while we ' ve made incredible advances in some areas , i think the risks for the tropics that are highlighted in this report are things that we really need to be concerned about . '',xxbos 3d printers are certainly the superstar today -- -they are being put to all kinds of uses , including creating model cars for movies . however , none of these ideas are as crazy as the one suggested by anjan contractor , who believes that they will be the key to ending world hunger . if you think that sounds a little crazy , you are not the only one , but after hearing scientists , the idea seems to become true . according to scientists , food will become _ expensive and possibly , even out of reach , for billions of people in the future . it means billions of people wo n't have enough food . this is where 3d printers may save the day . anjan , an engineer says that the only way to support the large population will be to provide every kitchen with a 3d printer and print out meals . more importantly , it would be to make the basic food from things that we now do not think can be eaten . anjan thinks that we could easily get the meat protein from insects . similarly , the vegetable nutrition could be made from greens like grass . would you want to try 3d printed food ?,xxbos i can still remember it as if it happened yesterday . i was a college freshman and had stayed up most of the night before laughing and talking with friends . now just before my first class of the day my eyelids were feeling heavier and heavier and my head was drifting down to my desk to make my textbook a pillow . a few minutes ' nap time before class could n't hurt , i thought . boom ! i lifted my head immediately and my eyes opened wider than saucers . i looked around with my heart beating quickly trying to find the cause of the noise . my young professor was looking back at me with a _ , boyish smile on his face . he had intentionally dropped the pile of textbooks he was carrying onto my desk . ` ` good morning ! '' he said , still smiling . ` ` i ' m glad to see everyone is awake . now let 's get started . '' for the next hour i was n't sleepy at all . it was n't from the shock of my professor 's textbook alarm clock either . instead , it was from the attractive discussion he led . with knowledge and good humor , he made the material come alive . his insights were full of both wisdom and loving kindness . and the enthusiasm and joy that he taught with were contagious . i left the classroom not only wide awake , but a little smarter and a little better as well . i learned something far more important than not sleeping in class that day too . i learned that if you are going to do something in this life , do it well , do it with joy , and make it an expression of your love . what a glorious place this world would be if all of us did our work joyously and well ! what a beautiful world we could create if every doctor , teacher , musician , cook , waitress , poet , miner , farmer , and laborer made their work an expression of their love ! do n't sleepwalk your way through life then . wake up ! let your love fill your work and your soul . life is too short not to live it well .\n",
       "y: CategoryList\n",
       "high,high,high,middle,high\n",
       "Path: /content/race/input;\n",
       "\n",
       "Valid: LabelList (5028 items)\n",
       "x: TextList\n",
       "xxbos living in a modern society has its advantages and disadvantages . one disadvantage is that you often have to live closer to other people than you would like to . sometimes , your neighbors make a noise that you are not comfortable with . the best way to solve this problem is to talk with your neighbor first . you should be very polite and ask your neighbor if he knows how thin the walls of your homes are . this way does n't criticize his behavior ; it simply points out that he may not realize how far his sound travels . tell him that you know that sometimes you make noise as well , but that you do your best to keep it down . often this will solve the problem right away , but sometimes the neighbor may become angry . if your neighbor becomes angry with you , there are some more steps you can take . you might write a letter to the neighborhood committee . make sure you write down the source of the noise and the time in the letter . they will review the situation and decide whether your neighbor is out of line . some noise is considered to be _ , even if it bothers you . so you may prepare a good pair of earplugs . even if your neighbor makes too much noise , you do n't have to live your life in discomfort . it 's always a good idea to be friendly with your neighbors . you may clean the rubbish in front of his door . he 's sure to appreciate behavior like this and be more open to your suggestions about noise level .,xxbos a gunman opened fire in orlando 's pulse nightclub early morning sunday , killing approximately 50 people and injuring another 53 . xxunk were enjoying an evening at pulse , which describes itself as ` ` the hottest gay bar in orlando , ` ` when shots started to go off around 2 am . a hostage situation occurred , and did n't end until authorities used a vehicle armed to teeth to break down the door of the building and kill the gunman at around 5 am . sunday morning 's attack surpasses the shootings at virginia tech in 2007 and xxunk hook elementary school in 2012 to become the worst mass shooting in us history . authorities have identified the shooter as 29-year - old omar xxunk mateen from fort pierce , about 120 miles southeast of orlando . cnn reports mr . mateen was previously trained as a security guard . the federal government and fbi ` ` have suggestions the individual has xxunk towards islamic terrorism , but right now we ca n't say definitely , ` ` says ron hopper , assistant special agent of fbi 's orlando bureau . but mateen 's connection to islamic terrorism has not been proven , leading authorities to also investigate the shooting as a possible hate crime against the lgbt community . the orlando blood donation facility tweeted that the bank was in ` ` urgent need ` ` of donations sunday morning following the shooting . but within hours , they announced their bank was at capacity due to the long lines of volunteers who showed up to donate . however , after the initial tweet at 10:40 sunday morning , criticisms of the united states ' stand on blood donation by the lgbt community resurfaced on social media from those who wanted to help but were prohibited due to their sexuality . '' it 's legal to buy an xxunk assault rifle . it 's illegal for a gay man to donate blood to victims of the massacre . the world makes no sense . ` ` said john xxunk . ( lgbt : a community of four types of people ; lesbian , gay , xxunk , transgender . ),xxbos dear dr . white , welcome to philadelphia ! welcome to the city of brotherly love ! we have some amazing historic sites to see during your stay . do take advantage of them . you may have seen the xxunk . actually it is a comedy and still popular among the young though it was shot in the 1940s . ` ` the city of brotherly love '' , the favored nickname for philadelphia , is more popular . the name , philadelphia , which means '' brotherly love '' , is an ancient name that can be found in the bible . late in the 17th century , philadelphia 's founding father , william penn , borrowed the name because its meaning represented his own beliefs . our first stop will be the franklin institute which is one of the country 's best science museums . the scientist and inventor benjamin franklin would take pride in the impressive museum named for him and presenting one of the major focuses of his life work -- spreading knowledge of the universe through science . it 's the most visited museum and surely the most fun . benjamin franklin was one of the founding fathers of the united states . also franklin was a leading author , printer , politician , scientist , musician , inventor , statesman , and diplomat . as a scientist , he was a major figure in the american enlightenment and the history of physics for his discoveries and theories regarding electricity . he earned the title of '' the first american '' for his campaigning for colonial unity ; as an author and spokesman in london for several colonies , then as the first united states ambassador to france , he contributed much to the building of the american nation . we wo n't miss please touch museum too . the straightforward name of this museum is accurate : as the first museum in the nation to target children aged seven and younger , please touch museum encourages children to learn through active touching and doing . it is certainly one of the best places for kids . philadelphia is also unique in that it has a '' state store '' system for non - alcoholic beer sales . wine and spirits are only sold at stores operated by the pennsylvania liquor control board . for many years , these stores were called '' state store '' , which were strictly closed on sundays to prevent those under 21 from drinking wine and harming others . but i will show you around the stores . you ca n't imagine how impressive the stores are . do you know segway ? it is a two - wheeled self - balancing battery - powered electric vehicle which is popular among those who prefer personal and green transportation . the segway tour is a unique and fun experience to travel in philadelphia . if you have never experienced a segway tour before , we expect you to join us . look forward to your coming ! sincerely , joy,xxbos mr . jones and mr . brown work in the same office . one day mr . jones says to mr . brown , ` ` i will have a small party at our house on monday evening . would you and your wife like to come ? '' mr . brown says , ` ` thank you very much . i 'd love to , but let me ask my wife first . '' so mr . brown goes to the other room and telephones his wife . then he comes back and looks very _ . ` ` what 's the matter ? '' asks mr . jones . ` ` is your wife there at home ? '' ` ` no , '' answers mr . brown . ` ` she is n't there . my son answers the telephone . i say to him , ' is your mother here , david ? ' and he answers , ' no , she is n't in the house . ' ' where is she ? ' i ask . ' she is somewhere outside . ' ' what 's she doing ? ' ' she is looking for me . ' '',xxbos friends with kids was put on in american theatres on march 9th , 2012 . its writer and director is jennifer westfeldt . it 's a _ about some friends at that time in life when children arrive and everything changes . it will make you feel happy and funny and ca n't help laughing . in the movie , the last two singles westfeldt and adam scott , decided to make a test -- to have a kid together and meet other people . most people will be surprised at what happens in the movie . it can help you think of more about your love for your xxunk and family . the famous stars in the movie are adam scott . jennifer westfeldt , jon xxunk , kristen xxunk , maya rudolph , chris xxunk , megan fox , and edward burns . you can also visit this movie 's official website . , .\n",
       "y: CategoryList\n",
       "high,high,high,middle,middle\n",
       "Path: /content/race/input;\n",
       "\n",
       "Test: None, model=SequentialRNN(\n",
       "  (0): MultiBatchEncoder(\n",
       "    (module): AWD_LSTM(\n",
       "      (encoder): Embedding(41904, 400, padding_idx=1)\n",
       "      (encoder_dp): EmbeddingDropout(\n",
       "        (emb): Embedding(41904, 400, padding_idx=1)\n",
       "      )\n",
       "      (rnns): ModuleList(\n",
       "        (0): WeightDropout(\n",
       "          (module): LSTM(400, 1152, batch_first=True)\n",
       "        )\n",
       "        (1): WeightDropout(\n",
       "          (module): LSTM(1152, 1152, batch_first=True)\n",
       "        )\n",
       "        (2): WeightDropout(\n",
       "          (module): LSTM(1152, 400, batch_first=True)\n",
       "        )\n",
       "      )\n",
       "      (input_dp): RNNDropout()\n",
       "      (hidden_dps): ModuleList(\n",
       "        (0): RNNDropout()\n",
       "        (1): RNNDropout()\n",
       "        (2): RNNDropout()\n",
       "      )\n",
       "    )\n",
       "  )\n",
       "  (1): PoolingLinearClassifier(\n",
       "    (layers): Sequential(\n",
       "      (0): BatchNorm1d(1200, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
       "      (1): Dropout(p=0.2, inplace=False)\n",
       "      (2): Linear(in_features=1200, out_features=50, bias=True)\n",
       "      (3): ReLU(inplace=True)\n",
       "      (4): BatchNorm1d(50, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
       "      (5): Dropout(p=0.1, inplace=False)\n",
       "      (6): Linear(in_features=50, out_features=2, bias=True)\n",
       "    )\n",
       "  )\n",
       "), opt_func=functools.partial(<class 'torch.optim.adam.Adam'>, betas=(0.9, 0.99)), loss_func=FlattenedLoss of CrossEntropyLoss(), metrics=[<function accuracy at 0x7f2e90106730>], true_wd=True, bn_wd=True, wd=0.01, train_bn=True, path=PosixPath('/content/race/input'), model_dir=PosixPath('/content/race/working'), callback_fns=[functools.partial(<class 'fastai.basic_train.Recorder'>, add_time=True, silent=False)], callbacks=[...], layer_groups=[Sequential(\n",
       "  (0): Embedding(41904, 400, padding_idx=1)\n",
       "  (1): EmbeddingDropout(\n",
       "    (emb): Embedding(41904, 400, padding_idx=1)\n",
       "  )\n",
       "), Sequential(\n",
       "  (0): WeightDropout(\n",
       "    (module): LSTM(400, 1152, batch_first=True)\n",
       "  )\n",
       "  (1): RNNDropout()\n",
       "), Sequential(\n",
       "  (0): WeightDropout(\n",
       "    (module): LSTM(1152, 1152, batch_first=True)\n",
       "  )\n",
       "  (1): RNNDropout()\n",
       "), Sequential(\n",
       "  (0): WeightDropout(\n",
       "    (module): LSTM(1152, 400, batch_first=True)\n",
       "  )\n",
       "  (1): RNNDropout()\n",
       "), Sequential(\n",
       "  (0): PoolingLinearClassifier(\n",
       "    (layers): Sequential(\n",
       "      (0): BatchNorm1d(1200, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
       "      (1): Dropout(p=0.2, inplace=False)\n",
       "      (2): Linear(in_features=1200, out_features=50, bias=True)\n",
       "      (3): ReLU(inplace=True)\n",
       "      (4): BatchNorm1d(50, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
       "      (5): Dropout(p=0.1, inplace=False)\n",
       "      (6): Linear(in_features=50, out_features=2, bias=True)\n",
       "    )\n",
       "  )\n",
       ")], add_time=True, silent=False)\n",
       "alpha: 2.0\n",
       "beta: 1.0, MixedPrecision\n",
       "learn: RNNLearner(data=TextClasDataBunch;\n",
       "\n",
       "Train: LabelList (20109 items)\n",
       "x: TextList\n",
       "xxbos paris in the springtime was , is and always will be , something rather special . why not experience it for yourself with this excellent break for four days ? this attractive city has something to offer to everyone and with prices at just ps129 . your break begins with comfortable bus transfer from local pick - up points and travel to paris is via cross - channel ferry , arriving at your hotel in the evening . the ibis is an excellent quality hotel with private equipments in all rooms : satellite tv , radio , telephone and alarm clock . it has a bar and restaurant and is situated about two miles south of notre dame enabling you to explore paris with ease . the following day , after continental breakfast ( included ) , the bus takes you on a comprehensive sightseeing tour of the city , during which you will see the eiffel tower , champs elysees , l'arc de triomphe , the louvre , in fact almost every famous landmark you have ever heard of . you then leave paris and take a short drive to the magnificent palace of versailles , the home of louis xiv . the tour ends mid - afternoon back in paris where you will have the remainder of the day at your leisure . in the evening there is a ` ` paris by night '' tour showing you the beautiful buildings with bright lights . day three takes you to xxunk , perhaps the most attractive quarter of paris and home of the sacre coeur and the moulin rouge . in the afternoon you are free to explore this beautiful city as you wish , perhaps a pleasure voyage on the river seine , wander around the beautiful gardens or look among the antique shops . in the evening you will have the opportunity to visit the best nightclub in the city , the splendid xxunk xxunk . on the final day it 's back to the uk via channel ferry . included in the price of ps129 per person : * return comfortable bus travel to paris * return ferry crossings * 3 nights housing in a twin bedded room in a central paris hotel with private facilities * continental breakfast during your stay * guided sightseeing tour of ` ` paris by day '' and paris by night '' * visit to the chateau of versailles ( admission not included ) * tour around montmartre * services of experienced bi - lingual tour guide at all times,xxbos drunken driving -sometimes called america 's socially accepted form of murder -- has become a national epidemic . every hour of every day about three americans on average are killed by drunken drivers , adding up to an incredible 250,000 over the past ten years . a drunken driver is usually referred to as one with xxunk alcohol content or roughly three beer glasses of wine or shots of whisky drunk within two hours . heavy drinking used to be an acceptable part of the american manly image and judges were in most courts , but the drunken killing has recently caused so many well - publicized tragedies , especially concerning young children , that public opinion is no longer so tolerant . twenty states have raised the legal drinking age to 21 , reversing a trend in the 1960s to reduce it to 18 . after new jersey lowered it to 18 , the number of people killed by 18 - 20 years old drivers more than doubled , so the state recently upped it back to 21 . reformers , however , fear raising the drinking age will have little effect unless accompanied by educational programs to help young people to develop ' responsible attitudes ' about drinking and teach them to resist peer pressure to drink . though new laws have led to increased arrests and tests in many areas already , to a marked drop in accidents , some states are also punishing bars for serving customers too many drinks . a bar in massachusetts was fined for serving six or more double xxunk to a customer who was ' obviously drunk ' and later drove off the road , killing a 9-year - old boy . as the accidents continue to occur daily in every state , some americans are even beginning to speak well of the 13 years national prohibition of alcohol that began in 1919 , which president hoover called the ' noble experiment ' . they forgot that legal prohibition did n't stop drinking , but encouraged political corruption and organized crime . as with the booming drug trade generally , there is no easy solution .,xxbos by 2050 , half of the world 's population will live in the tropics -- the ly warm belt that circles the globe -- according to state of the tropics , a report released today . rapid population growth , along with economic growth , means that the region 's influence will grow in coming decades , the authors of the xxunk work predict . the project , first launched in 2011 , aimed to answer one significant question : is life in the tropics improving ? to find out , the researchers analyzed environmental , social , and economic indicators collected over 6 decades . it finds that the region has made ` ` extraordinary progress '' in many areas . for example , more people have access to safe drinking water , and the number of protected areas is increasing . the tropics also have outperformed the rest of the world in economic growth over the past 30 years . however , some challenges remain . investment in research and development , for example , has increased cautiously , but tropical nations still invest less than the rest of the world . ` ` as a proportion of gdp the rest of the world invests almost four times as much in research and development than the tropics . '' concludes the report . the report also includes a new analysis of how climate change will affect the region . many plant and animal species are moving xxunk in an attempt to stay within their preferred environmental conditions in the tropics , the authors write . however , some organisms may not be able to keep pace with the changing conditions , they predict . as a result , they can experience population declines or go extinct . in addition , an expanded tropical zone also threatens health and safety issues , the authors warn . as regions become more suitable to insects such as mosquitoes and ticks , the spread of insect - borne diseases such as malaria , dengue , and xxunk disease could rise , causing a burden to human health and the economy . xxunk , a researcher , says he sees a lot to be concerned about in the report . ` ` while we ' ve made incredible advances in some areas , i think the risks for the tropics that are highlighted in this report are things that we really need to be concerned about . '',xxbos 3d printers are certainly the superstar today -- -they are being put to all kinds of uses , including creating model cars for movies . however , none of these ideas are as crazy as the one suggested by anjan contractor , who believes that they will be the key to ending world hunger . if you think that sounds a little crazy , you are not the only one , but after hearing scientists , the idea seems to become true . according to scientists , food will become _ expensive and possibly , even out of reach , for billions of people in the future . it means billions of people wo n't have enough food . this is where 3d printers may save the day . anjan , an engineer says that the only way to support the large population will be to provide every kitchen with a 3d printer and print out meals . more importantly , it would be to make the basic food from things that we now do not think can be eaten . anjan thinks that we could easily get the meat protein from insects . similarly , the vegetable nutrition could be made from greens like grass . would you want to try 3d printed food ?,xxbos i can still remember it as if it happened yesterday . i was a college freshman and had stayed up most of the night before laughing and talking with friends . now just before my first class of the day my eyelids were feeling heavier and heavier and my head was drifting down to my desk to make my textbook a pillow . a few minutes ' nap time before class could n't hurt , i thought . boom ! i lifted my head immediately and my eyes opened wider than saucers . i looked around with my heart beating quickly trying to find the cause of the noise . my young professor was looking back at me with a _ , boyish smile on his face . he had intentionally dropped the pile of textbooks he was carrying onto my desk . ` ` good morning ! '' he said , still smiling . ` ` i ' m glad to see everyone is awake . now let 's get started . '' for the next hour i was n't sleepy at all . it was n't from the shock of my professor 's textbook alarm clock either . instead , it was from the attractive discussion he led . with knowledge and good humor , he made the material come alive . his insights were full of both wisdom and loving kindness . and the enthusiasm and joy that he taught with were contagious . i left the classroom not only wide awake , but a little smarter and a little better as well . i learned something far more important than not sleeping in class that day too . i learned that if you are going to do something in this life , do it well , do it with joy , and make it an expression of your love . what a glorious place this world would be if all of us did our work joyously and well ! what a beautiful world we could create if every doctor , teacher , musician , cook , waitress , poet , miner , farmer , and laborer made their work an expression of their love ! do n't sleepwalk your way through life then . wake up ! let your love fill your work and your soul . life is too short not to live it well .\n",
       "y: CategoryList\n",
       "high,high,high,middle,high\n",
       "Path: /content/race/input;\n",
       "\n",
       "Valid: LabelList (5028 items)\n",
       "x: TextList\n",
       "xxbos living in a modern society has its advantages and disadvantages . one disadvantage is that you often have to live closer to other people than you would like to . sometimes , your neighbors make a noise that you are not comfortable with . the best way to solve this problem is to talk with your neighbor first . you should be very polite and ask your neighbor if he knows how thin the walls of your homes are . this way does n't criticize his behavior ; it simply points out that he may not realize how far his sound travels . tell him that you know that sometimes you make noise as well , but that you do your best to keep it down . often this will solve the problem right away , but sometimes the neighbor may become angry . if your neighbor becomes angry with you , there are some more steps you can take . you might write a letter to the neighborhood committee . make sure you write down the source of the noise and the time in the letter . they will review the situation and decide whether your neighbor is out of line . some noise is considered to be _ , even if it bothers you . so you may prepare a good pair of earplugs . even if your neighbor makes too much noise , you do n't have to live your life in discomfort . it 's always a good idea to be friendly with your neighbors . you may clean the rubbish in front of his door . he 's sure to appreciate behavior like this and be more open to your suggestions about noise level .,xxbos a gunman opened fire in orlando 's pulse nightclub early morning sunday , killing approximately 50 people and injuring another 53 . xxunk were enjoying an evening at pulse , which describes itself as ` ` the hottest gay bar in orlando , ` ` when shots started to go off around 2 am . a hostage situation occurred , and did n't end until authorities used a vehicle armed to teeth to break down the door of the building and kill the gunman at around 5 am . sunday morning 's attack surpasses the shootings at virginia tech in 2007 and xxunk hook elementary school in 2012 to become the worst mass shooting in us history . authorities have identified the shooter as 29-year - old omar xxunk mateen from fort pierce , about 120 miles southeast of orlando . cnn reports mr . mateen was previously trained as a security guard . the federal government and fbi ` ` have suggestions the individual has xxunk towards islamic terrorism , but right now we ca n't say definitely , ` ` says ron hopper , assistant special agent of fbi 's orlando bureau . but mateen 's connection to islamic terrorism has not been proven , leading authorities to also investigate the shooting as a possible hate crime against the lgbt community . the orlando blood donation facility tweeted that the bank was in ` ` urgent need ` ` of donations sunday morning following the shooting . but within hours , they announced their bank was at capacity due to the long lines of volunteers who showed up to donate . however , after the initial tweet at 10:40 sunday morning , criticisms of the united states ' stand on blood donation by the lgbt community resurfaced on social media from those who wanted to help but were prohibited due to their sexuality . '' it 's legal to buy an xxunk assault rifle . it 's illegal for a gay man to donate blood to victims of the massacre . the world makes no sense . ` ` said john xxunk . ( lgbt : a community of four types of people ; lesbian , gay , xxunk , transgender . ),xxbos dear dr . white , welcome to philadelphia ! welcome to the city of brotherly love ! we have some amazing historic sites to see during your stay . do take advantage of them . you may have seen the xxunk . actually it is a comedy and still popular among the young though it was shot in the 1940s . ` ` the city of brotherly love '' , the favored nickname for philadelphia , is more popular . the name , philadelphia , which means '' brotherly love '' , is an ancient name that can be found in the bible . late in the 17th century , philadelphia 's founding father , william penn , borrowed the name because its meaning represented his own beliefs . our first stop will be the franklin institute which is one of the country 's best science museums . the scientist and inventor benjamin franklin would take pride in the impressive museum named for him and presenting one of the major focuses of his life work -- spreading knowledge of the universe through science . it 's the most visited museum and surely the most fun . benjamin franklin was one of the founding fathers of the united states . also franklin was a leading author , printer , politician , scientist , musician , inventor , statesman , and diplomat . as a scientist , he was a major figure in the american enlightenment and the history of physics for his discoveries and theories regarding electricity . he earned the title of '' the first american '' for his campaigning for colonial unity ; as an author and spokesman in london for several colonies , then as the first united states ambassador to france , he contributed much to the building of the american nation . we wo n't miss please touch museum too . the straightforward name of this museum is accurate : as the first museum in the nation to target children aged seven and younger , please touch museum encourages children to learn through active touching and doing . it is certainly one of the best places for kids . philadelphia is also unique in that it has a '' state store '' system for non - alcoholic beer sales . wine and spirits are only sold at stores operated by the pennsylvania liquor control board . for many years , these stores were called '' state store '' , which were strictly closed on sundays to prevent those under 21 from drinking wine and harming others . but i will show you around the stores . you ca n't imagine how impressive the stores are . do you know segway ? it is a two - wheeled self - balancing battery - powered electric vehicle which is popular among those who prefer personal and green transportation . the segway tour is a unique and fun experience to travel in philadelphia . if you have never experienced a segway tour before , we expect you to join us . look forward to your coming ! sincerely , joy,xxbos mr . jones and mr . brown work in the same office . one day mr . jones says to mr . brown , ` ` i will have a small party at our house on monday evening . would you and your wife like to come ? '' mr . brown says , ` ` thank you very much . i 'd love to , but let me ask my wife first . '' so mr . brown goes to the other room and telephones his wife . then he comes back and looks very _ . ` ` what 's the matter ? '' asks mr . jones . ` ` is your wife there at home ? '' ` ` no , '' answers mr . brown . ` ` she is n't there . my son answers the telephone . i say to him , ' is your mother here , david ? ' and he answers , ' no , she is n't in the house . ' ' where is she ? ' i ask . ' she is somewhere outside . ' ' what 's she doing ? ' ' she is looking for me . ' '',xxbos friends with kids was put on in american theatres on march 9th , 2012 . its writer and director is jennifer westfeldt . it 's a _ about some friends at that time in life when children arrive and everything changes . it will make you feel happy and funny and ca n't help laughing . in the movie , the last two singles westfeldt and adam scott , decided to make a test -- to have a kid together and meet other people . most people will be surprised at what happens in the movie . it can help you think of more about your love for your xxunk and family . the famous stars in the movie are adam scott . jennifer westfeldt , jon xxunk , kristen xxunk , maya rudolph , chris xxunk , megan fox , and edward burns . you can also visit this movie 's official website . , .\n",
       "y: CategoryList\n",
       "high,high,high,middle,middle\n",
       "Path: /content/race/input;\n",
       "\n",
       "Test: None, model=SequentialRNN(\n",
       "  (0): MultiBatchEncoder(\n",
       "    (module): AWD_LSTM(\n",
       "      (encoder): Embedding(41904, 400, padding_idx=1)\n",
       "      (encoder_dp): EmbeddingDropout(\n",
       "        (emb): Embedding(41904, 400, padding_idx=1)\n",
       "      )\n",
       "      (rnns): ModuleList(\n",
       "        (0): WeightDropout(\n",
       "          (module): LSTM(400, 1152, batch_first=True)\n",
       "        )\n",
       "        (1): WeightDropout(\n",
       "          (module): LSTM(1152, 1152, batch_first=True)\n",
       "        )\n",
       "        (2): WeightDropout(\n",
       "          (module): LSTM(1152, 400, batch_first=True)\n",
       "        )\n",
       "      )\n",
       "      (input_dp): RNNDropout()\n",
       "      (hidden_dps): ModuleList(\n",
       "        (0): RNNDropout()\n",
       "        (1): RNNDropout()\n",
       "        (2): RNNDropout()\n",
       "      )\n",
       "    )\n",
       "  )\n",
       "  (1): PoolingLinearClassifier(\n",
       "    (layers): Sequential(\n",
       "      (0): BatchNorm1d(1200, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
       "      (1): Dropout(p=0.2, inplace=False)\n",
       "      (2): Linear(in_features=1200, out_features=50, bias=True)\n",
       "      (3): ReLU(inplace=True)\n",
       "      (4): BatchNorm1d(50, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
       "      (5): Dropout(p=0.1, inplace=False)\n",
       "      (6): Linear(in_features=50, out_features=2, bias=True)\n",
       "    )\n",
       "  )\n",
       "), opt_func=functools.partial(<class 'torch.optim.adam.Adam'>, betas=(0.9, 0.99)), loss_func=FlattenedLoss of CrossEntropyLoss(), metrics=[<function accuracy at 0x7f2e90106730>], true_wd=True, bn_wd=True, wd=0.01, train_bn=True, path=PosixPath('/content/race/input'), model_dir=PosixPath('/content/race/working'), callback_fns=[functools.partial(<class 'fastai.basic_train.Recorder'>, add_time=True, silent=False)], callbacks=[...], layer_groups=[Sequential(\n",
       "  (0): Embedding(41904, 400, padding_idx=1)\n",
       "  (1): EmbeddingDropout(\n",
       "    (emb): Embedding(41904, 400, padding_idx=1)\n",
       "  )\n",
       "), Sequential(\n",
       "  (0): WeightDropout(\n",
       "    (module): LSTM(400, 1152, batch_first=True)\n",
       "  )\n",
       "  (1): RNNDropout()\n",
       "), Sequential(\n",
       "  (0): WeightDropout(\n",
       "    (module): LSTM(1152, 1152, batch_first=True)\n",
       "  )\n",
       "  (1): RNNDropout()\n",
       "), Sequential(\n",
       "  (0): WeightDropout(\n",
       "    (module): LSTM(1152, 400, batch_first=True)\n",
       "  )\n",
       "  (1): RNNDropout()\n",
       "), Sequential(\n",
       "  (0): PoolingLinearClassifier(\n",
       "    (layers): Sequential(\n",
       "      (0): BatchNorm1d(1200, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
       "      (1): Dropout(p=0.2, inplace=False)\n",
       "      (2): Linear(in_features=1200, out_features=50, bias=True)\n",
       "      (3): ReLU(inplace=True)\n",
       "      (4): BatchNorm1d(50, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
       "      (5): Dropout(p=0.1, inplace=False)\n",
       "      (6): Linear(in_features=50, out_features=2, bias=True)\n",
       "    )\n",
       "  )\n",
       ")], add_time=True, silent=False)\n",
       "loss_scale: 65536\n",
       "max_noskip: 1000\n",
       "dynamic: True\n",
       "clip: None\n",
       "flat_master: False\n",
       "max_scale: 16777216\n",
       "loss_fp32: True], layer_groups=[Sequential(\n",
       "  (0): Embedding(41904, 400, padding_idx=1)\n",
       "  (1): EmbeddingDropout(\n",
       "    (emb): Embedding(41904, 400, padding_idx=1)\n",
       "  )\n",
       "), Sequential(\n",
       "  (0): WeightDropout(\n",
       "    (module): LSTM(400, 1152, batch_first=True)\n",
       "  )\n",
       "  (1): RNNDropout()\n",
       "), Sequential(\n",
       "  (0): WeightDropout(\n",
       "    (module): LSTM(1152, 1152, batch_first=True)\n",
       "  )\n",
       "  (1): RNNDropout()\n",
       "), Sequential(\n",
       "  (0): WeightDropout(\n",
       "    (module): LSTM(1152, 400, batch_first=True)\n",
       "  )\n",
       "  (1): RNNDropout()\n",
       "), Sequential(\n",
       "  (0): PoolingLinearClassifier(\n",
       "    (layers): Sequential(\n",
       "      (0): BatchNorm1d(1200, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
       "      (1): Dropout(p=0.2, inplace=False)\n",
       "      (2): Linear(in_features=1200, out_features=50, bias=True)\n",
       "      (3): ReLU(inplace=True)\n",
       "      (4): BatchNorm1d(50, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
       "      (5): Dropout(p=0.1, inplace=False)\n",
       "      (6): Linear(in_features=50, out_features=2, bias=True)\n",
       "    )\n",
       "  )\n",
       ")], add_time=True, silent=False)"
      ]
     },
     "execution_count": 29,
     "metadata": {
      "tags": []
     },
     "output_type": "execute_result"
    }
   ],
   "source": [
    "learn = text_classifier_learner(data_clas, AWD_LSTM, drop_mult=0.5).to_fp16()\r\n",
    "learn.model_dir = Path('/content/race/working/')\r\n",
    "learn.load_encoder('language_model_encoder')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/",
     "height": 289
    },
    "id": "ufxW4xKRz5NQ",
    "outputId": "d7556abf-d7f4-4b15-f628-9ae343645dfb"
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th>text</th>\n",
       "      <th>target</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>xxbos parents divorced , little buddy was in the care of his mother 's large alabama family . over the years , buddy seldom saw either of his parents . but he was happy where he was and he had many kindly s , among whom miss sook was by far his best friend . before christmas , buddy 's father had managed to get legal custody of him for</td>\n",
       "      <td>high</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>xxbos a long time ago , there lived a poor man whose real name has been forgotten . he was little and old and his face was wrinkled , and that was why his friends called him mr . vinegar . his wife was also little and old , and they lived in a little old cottage at the back of a little old field . ` ` john ,</td>\n",
       "      <td>high</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>xxbos my daughter allie is leaving for college in a week . her room is piled with shopping bags filled with blankets , towels , jeans , sweaters . she wo n't talk about going . i say , ` ` i ' m going to miss you , '' and she gives me one of her looks and leaves the room . another time i say , in a</td>\n",
       "      <td>high</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>xxbos today i was at the mall waiting for friends , when a lady wearing a knit hat and a sweater came up to me and , shivering , said , ` ` i ' m homeless . would you mind buying me some food ? '' in that split second , everything i 'd learned since kindergarten flashed through my mind . do n't talk to strangers ... be</td>\n",
       "      <td>high</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>xxbos old behrman was a painter who lived on the ground floor of the apartment building . for years , he had always been planning to paint a work of art , but had never yet begun it . he earned a little money by serving as a model to artists who could not pay for a professional model . he was a fierce , little , old man who</td>\n",
       "      <td>high</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {
      "tags": []
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "data_clas.show_batch()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/",
     "height": 80
    },
    "id": "D4RetvX50XvN",
    "outputId": "cc44adf9-a624-415f-a39f-eb2a2c1bf823"
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: left;\">\n",
       "      <th>epoch</th>\n",
       "      <th>train_loss</th>\n",
       "      <th>valid_loss</th>\n",
       "      <th>accuracy</th>\n",
       "      <th>time</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>0</td>\n",
       "      <td>0.467537</td>\n",
       "      <td>0.302752</td>\n",
       "      <td>0.875099</td>\n",
       "      <td>01:23</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {
      "tags": []
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "learn.fit_one_cycle(1, 5e-2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/",
     "height": 142
    },
    "id": "feJ3emFz0bLv",
    "outputId": "e8e4c6c7-bbb0-4b41-f8b7-803487979683"
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: left;\">\n",
       "      <th>epoch</th>\n",
       "      <th>train_loss</th>\n",
       "      <th>valid_loss</th>\n",
       "      <th>accuracy</th>\n",
       "      <th>time</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>0</td>\n",
       "      <td>0.407520</td>\n",
       "      <td>0.312172</td>\n",
       "      <td>0.864757</td>\n",
       "      <td>02:50</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>1</td>\n",
       "      <td>0.352568</td>\n",
       "      <td>0.280184</td>\n",
       "      <td>0.891010</td>\n",
       "      <td>02:42</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2</td>\n",
       "      <td>0.277036</td>\n",
       "      <td>0.255863</td>\n",
       "      <td>0.894193</td>\n",
       "      <td>02:50</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {
      "tags": []
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "learn.unfreeze()\r\n",
    "learn.fit_one_cycle(3, slice(1e-4, 1e-2))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/"
    },
    "id": "ai61UKYC1hTK",
    "outputId": "9583711b-b4eb-4318-da79-9d131ea91464"
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(Category tensor(1), tensor(1), tensor([0.3961, 0.6039]))"
      ]
     },
     "execution_count": 33,
     "metadata": {
      "tags": []
     },
     "output_type": "execute_result"
    }
   ],
   "source": [
    "learn.predict('This game is absolute shit! Dont waste your money!')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/"
    },
    "id": "68D0Lb_w1j-A",
    "outputId": "5a2868af-6551-43b4-e090-5c15959077f9"
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(Category tensor(1), tensor(1), tensor([0.2413, 0.7587]))"
      ]
     },
     "execution_count": 35,
     "metadata": {
      "tags": []
     },
     "output_type": "execute_result"
    }
   ],
   "source": [
    "learn.predict('The best button of the game is exit button')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "id": "TeTcWj221ozf"
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "accelerator": "GPU",
  "colab": {
   "name": "kaggle_nlp_fl.ipynb",
   "provenance": []
  },
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
